home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / funky.zip / FUNKY.DOC < prev    next >
Text File  |  1993-02-20  |  2KB  |  46 lines

  1. -----------------------------------------------------------------
  2. FUNKY.COM              January 9,1993              Larry Furneaux
  3. -----------------------------------------------------------------
  4. Use for conditional branching in batch file process based on a
  5. return code (errorlevel) between 0 and 10 representing:
  6.  
  7.    ERRORLEVEL 0       -ESCape Key was pressed
  8.    ERRORLEVEL (1-10)  -Corresponding Function(#) key pressed
  9.  
  10. Invalid responses are ignored. Program will not return to the
  11. batch file process until a valid key is entered.
  12.  
  13. SYNTAX : FUNKY [promptstring] [/maxnum]
  14.  
  15. OPTIONS: promptstring- String to display before input is requested.
  16.        : /maxnum     - Digit 1 to 9. Sets max valid Fkey # accepted
  17.                as input.  (Default without switch = 10)
  18.  
  19.        Ex:  funky Enter your selection :/5
  20.  
  21.        Displays  'Enter your selection :'  at left edge of screen
  22.        with cursor positioned here------^. ESC and F1 to F5 would
  23.        be accepted. Input F# key is printed followed by CR and LF.
  24.  
  25. NOTES:
  26.    1. LEADING spaces on prompt string are ignored. Horiz tabbing can
  27.       be done with ANSI esc sequences or by entering a control char
  28.       as first char, followed by spaces + - text  string.
  29.       Ex: "^H<-    spaces  ->" as prompt string, positions cursor and
  30.       displays the input F-key at cursor location.
  31.    2. When invoked WITHOUT a prompt string, (with or without the
  32.       /maxnum switch), the input F- key is not displayed on screen.
  33.    3. The code parses only the 1st char following the '/'. Thus if
  34.       /10 was entered, it would be interpreted as 1. Omit the switch
  35.       to enable maxnum=10 (ie default).  If the char is not a digit
  36.       between 1 and 9, the switch is ignored and defaults to 10.
  37.   *4. The DOS "if errorlevel <num>" function evaluates as TRUE if the
  38.       returned error code is equal to OR GREATER THAN <num>.  Branch
  39.       testing must be done from HIGHEST value (maxnum) to LOWEST (0).
  40.       For non-sequential values (ex: Input F5 OR F10) test as follows:
  41.          IF errorlevel 10 Goto F10       { branch to :F10 label
  42.          IF errorlevel 6  Goto GetInput  { loop back if F6/7/8/9
  43.          IF errorlevel 5  Goto F5        { branch to :F5 label
  44.          IF errorlevel 1  Goto GetInput  { loop back if F1/2/3/4
  45.          GOTO ESCAPE                     { esc key pressed (errlvl 0)
  46.